module.exports = {
    win: null,
    status:0,
    open: function() {

    },
    close: function() {
        
    },
    init: function() {
        this.win = floaty.window(
            <frame>
                <button id="didiBtn" text="开滴" bg="#ff0000" textColor="#ffffff" textSize="20sp"/>
            </frame>
        )

        this.win.setPosition(800, 1850)
        ui.run(() => {
            this.win.didiBtn.click(() => {
                if (this.status == 0) {
                    app.launchApp("滴滴车主")
                    this.win.didiBtn.setText('关滴')
                    this.status = 1
                    
                } else {
                    // app.closeApp("滴滴车主")
                    app.launchApp("滴滴车主")
                    this.win.didiBtn.setText('开滴')
                    this.status = 0
                }   
            })
        })
        
    }
}